package com.atguigu.gmall.product.controller;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.product.entity.BaseSaleAttr;
import com.atguigu.gmall.product.entity.SpuSaleAttr;
import com.atguigu.gmall.product.service.BaseSaleAttrService;
import com.atguigu.gmall.product.service.SpuSaleAttrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/admin/product")
public class BaseSaleAttrController {
    /**
     * 查询所有销售属性的名
     * @return
     */
    @Autowired
    BaseSaleAttrService baseSaleAttrService;
    // http://weiranyi.xiaomy.net/admin/product/baseSaleAttrList
    @GetMapping("/baseSaleAttrList")
    public Result getSaleAttr(){
        List<BaseSaleAttr> list = baseSaleAttrService.list();
        return Result.ok(list);
    }


}
